import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.Reader;
import java.net.*;

public class Worker{
	
	
	PrintWriter out = null;
	ServerSocket ss = null;
	Socket s = null;
	public Worker(){
//		this.ssocket = conn;
	}
	public static void main(){
		Worker work = new Worker();
		work.fuehreaus();
	}
	public void fuehreaus(){
		
		
		try {
			 ss = new ServerSocket(58100);
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		while(true){
			try {
				Socket connection = ss.accept();
						
				if(s != null){System.out.println("connected1");}
				//Worker work = new Worker(connection);
				//BufferedReader read_in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
				
				BufferedReader bufR = new BufferedReader(new InputStreamReader(connection.getInputStream()));
				String myString = bufR.readLine();
				System.out.println(myString);
				
			}
			catch (IOException e) {e.printStackTrace();}
			finally {
				if (out != null) out.close();
			}
		}
}




			
		
		
	
	

}
